Home:ALL Converter>How to add a string to this function in Arduino C?

How to add a string to this function in Arduino C?

Ask Time:2019-12-31T12:04:00         Author:whoff

Json Formatter

I've been toying with this code, and been looking up solutions to this problem to no avail. I was told you were to add a string to a function like so in Arduino C++:

myFunction(String myString)

I've seen examples using this as well. This is the chunk of code that is having issues.

if (piezoV >= 0.25) {
    Serial.println(piezoV);
    // Serial.println(F("Playing track " + tracknum +""));
    String file = String(trackid) + String(tracknum) + String(ext);
    musicPlayer.playFullFile(String file);
    int tracknum = tracknum + 1;
  }

The code fetches this error:

musicPlayer.playFullFile(String file); - expected primary-expression before 'file'

I'm new to Arduino C++, and I am using experience from other languages I've learned to help, but I was wondering if SO could help me with this. Thanks in advance.

Author:whoff,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59539431/how-to-add-a-string-to-this-function-in-arduino-c
yy